<template>
    <view>
        <view class="wish-item">
            <view class="wish-item_user">
                <view class="wish-item_user__left">
                    <wish-ava></wish-ava>
                    <view class="wish-item_user__left-content" style="display: grid;">
                        <text class="wish-item_user__left-name">{{ detail.createName }}</text>
                        <text class="wish-item_user__left-time">{{ detail.createTime ? `${detail.createTime} 发出心愿` :
                            ''
                        }}</text>
                    </view>
                </view>
                <view class="wish-item_user__right">
                    <text class="wish-item_user__right-des">{{ `已有${detail.helpTimes}人助力` }}</text>
                </view>
            </view>

            <view class="wish-item_title">
                {{ detail.inputNameContent }}
            </view>

            <view class="wish-item_des">
                {{ detail.inputReasonContent }}
            </view>
        </view>
        <view class="wish-photo">
            <img class="wish-photo_item" :src="item.picPath" alt="" v-for="(item) in detail.imgList" :key="item.id">
        </view>
        <view class="wish-button">
            <Button>
                <text>我要助力</text>
            </Button>
        </view>
    </view>
</template>
<script lang="ts" setup>
import { onMounted, reactive, ref, onUnmounted } from 'vue';
import WishAva from '@/components/WishAva.vue'
import Button from '@/components/Button.vue'
import api from '@/apis/api';
import { onLoad } from '@dcloudio/uni-app';
const detail = ref({})
onLoad((e) => {
    api.getWish(e.id).then(({ data }) => {
        detail.value = data
    })
})

</script>

<style lang="scss" scoped>
.wish-item {
    padding: 0 30rpx;
    padding-top: 30rpx;

    .wish-item_user {
        display: flex;
        justify-content: space-between;
        align-items: center;

        .wish-item_user__left {
            display: flex;

            .wish-item_user__left-content {
                margin-left: 20rpx;

                .wish-item_user__left-time {
                    color: #999999;
                    font-size: 26rpx;
                }
            }

        }

        .wish-item_user__right-des {
            color: #666666;
            font-size: 26rpx;
        }
    }

    .wish-item_title {
        margin-top: 50rpx;
        color: #333333;
        font-size: 34rpx;
    }

    .wish-item_des {
        margin-top: 24rpx;
        color: #666666;
        font-size: 30rpx;
    }
}

.wish-photo {
    margin-top: 32rpx;

    .wish-photo_item {
        width: 100%;
        height: 420rpx;
        margin-bottom: 30rpx;

        &:last-child {
            margin-bottom: 0;
        }
    }

}

.wish-button {
    padding: 0 30rpx;
    padding-top: 30rpx;
    padding-bottom: 30rpx;
}
</style>